<?php /* Smarty version Smarty-3.1.14, created on 2017-08-17 09:53:09
         compiled from "E:\phpStudy\WWW\zyshop\admin\templates\shipping_area_edit.html" */ ?>
<?php /*%%SmartyHeaderCode:317775994f7059a9886-55109488%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '12dab4ae8a2234ad65f43b69722dff8adaf4a5eb' => 
    array (
      0 => 'E:\\phpStudy\\WWW\\zyshop\\admin\\templates\\shipping_area_edit.html',
      1 => 1502875561,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '317775994f7059a9886-55109488',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'sign' => 0,
    'aa' => 0,
    'fields' => 0,
    'regions' => 0,
    'region' => 0,
    'shipping_area_edit' => 0,
    'list' => 0,
    'shipping_id' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.14',
  'unifunc' => 'content_5994f705a029d9_91373294',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5994f705a029d9_91373294')) {function content_5994f705a029d9_91373294($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<style>
td {font-weight: bold;}
.firtd {	width: 100px;	padding-right: 10px;	text-align: right;}
textarea {	width: 350px;	height: 100px;}
.jz{margin-left:120px;}
.jh input{width: 20px;}
.jian{display: none; }
.zhong:first-child{width: 100px; padding-right: 10px;  text-align: right;};
</style>
<body>
<div class="fixed-bar">
  <div class="item-title">
    <h3><?php if ($_smarty_tpl->tpl_vars['sign']->value==1){?>添加配送区域<?php }?><?php if ($_smarty_tpl->tpl_vars['sign']->value==''){?>编辑配送区域<?php }?></h3>
  </div>
</div>
<div class="fixed_bottom">
  <form method="post" action="shipping_area.php" id="aspnetForm" name="form1" enctype="multipart/form-data">
  
    <table style=" width:100%;" cellpadding="0" cellspacing="0" class="table tb-type2">
        <tr>
          <td class="firtd">配送区域名称:</td>
          <td><input type="text" name="shipping_area_name"
          value="<?php echo $_smarty_tpl->tpl_vars['aa']->value['shipping_area_name'];?>
" id="name" <?php if ($_smarty_tpl->tpl_vars['aa']->value['shipping_area_id']){?> disabled="disabled" <?php }?>required>*</td> 
        </tr>
        <tr>
          <td class="firtd"> 货到付款:</td>
            <td>
              <input class="hd" style="width:15px" type="radio" onclick=abc1() name="fee_compute_mode" <?php if ($_smarty_tpl->tpl_vars['fields']->value[5]['value']=='by_weight'){?>checked=checked<?php }?> value="by_weight">按重量计算 &nbsp;&nbsp;&nbsp;&nbsp;
              <input class="hd" style="width:15px" type="radio" onclick=abc2() name="fee_compute_mode"<?php if ($_smarty_tpl->tpl_vars['fields']->value[5]['value']=='by_number'){?>checked=checked<?php }?> value="by_number">按商品件数计算 
            </td>
        </tr>
       
         <tr class="zhong">
          <td class="firtd"> 1000克以内费用：</td>
          <td><input type="text" name="<?php echo $_smarty_tpl->tpl_vars['fields']->value[0]['name'];?>
" value="<?php echo $_smarty_tpl->tpl_vars['fields']->value[0]['value'];?>
" required></td>
        </tr>
        <tr class="zhong">
          <td class="firtd"> 5000克以内续重每500克费用：</td>
          <td><input type="text" name="<?php echo $_smarty_tpl->tpl_vars['fields']->value[2]['name'];?>
" value="<?php echo $_smarty_tpl->tpl_vars['fields']->value[2]['value'];?>
" required></td>
        </tr>
        <tr class="zhong">
          <td class="firtd"> 5001克以上续重500克费用：</td>
          <td><input type="text" name="<?php echo $_smarty_tpl->tpl_vars['fields']->value[3]['name'];?>
" value="<?php echo $_smarty_tpl->tpl_vars['fields']->value[3]['value'];?>
" required></td>
        </tr>
       
        <tr class="jian">
          <td class="firtd"> 单件商品费用：</td>
          <td><input type="text" name="<?php echo $_smarty_tpl->tpl_vars['fields']->value[1]['name'];?>
" value="<?php echo $_smarty_tpl->tpl_vars['fields']->value[1]['value'];?>
" required></td>
        </tr>
      
        <tr>
          <td class="firtd"> 免费额度:</td>
          <td><input type="text" name="<?php echo $_smarty_tpl->tpl_vars['fields']->value[4]['name'];?>
" value="<?php echo $_smarty_tpl->tpl_vars['fields']->value[4]['value'];?>
" required></td>
        </tr>
    
    </table>
    <fieldset style="border:1px solid #DDEEF2">
      <span  style="vertical-align: top">所辖区域 </span>
      <table style="width:900px" align="center">
      <tr>
    <td id="regionCell">
      <?php  $_smarty_tpl->tpl_vars['region'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['region']->_loop = false;
 $_smarty_tpl->tpl_vars['id'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['regions']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['region']->key => $_smarty_tpl->tpl_vars['region']->value){
$_smarty_tpl->tpl_vars['region']->_loop = true;
 $_smarty_tpl->tpl_vars['id']->value = $_smarty_tpl->tpl_vars['region']->key;
?>
      <input type="checkbox" name="regions[]" value="" checked="" /> <?php echo $_smarty_tpl->tpl_vars['region']->value['region_name'];?>
&nbsp;&nbsp;
      <?php } ?>
    </td>
  </tr>
  <tr>
    <td>
        <span  style="vertical-align: top">国家 ：</span>
        <select name="country" id="selCountries" style="width:80px">
         <?php  $_smarty_tpl->tpl_vars['list'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['list']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['shipping_area_edit']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['list']->key => $_smarty_tpl->tpl_vars['list']->value){
$_smarty_tpl->tpl_vars['list']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['list']->key;
?>
         <?php if ($_smarty_tpl->tpl_vars['list']->value['region_type']==0){?>
          <option value="<?php echo $_smarty_tpl->tpl_vars['list']->value['region_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['list']->value['region_name'];?>
</option>
          <?php }?>
          <?php } ?>
        </select>
        <span style="vertical-align: top">省份 ：</span>
        <select name="province" id="selProvinces" onchange="get_diqu('selProvinces','selCities')" style="width:80px">
          <?php  $_smarty_tpl->tpl_vars['list'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['list']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['shipping_area_edit']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['list']->key => $_smarty_tpl->tpl_vars['list']->value){
$_smarty_tpl->tpl_vars['list']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['list']->key;
?>
          <?php if ($_smarty_tpl->tpl_vars['list']->value['region_type']==1){?>
          <option value='<?php echo $_smarty_tpl->tpl_vars['list']->value['region_id'];?>
'><?php echo $_smarty_tpl->tpl_vars['list']->value['region_name'];?>
</option>
          <?php }?>
          <?php } ?>
        </select>

        <span style="vertical-align: top">城市：</span>
        <select name="city" id="selCities" onchange="get_diqu('selCities','selDistricts')" style="width:80px" required>
          <option value=''>=请选择=</option>
        </select>
        <span  style="vertical-align: top">区/县:</span>
        <select name="district" id="selDistricts" style="width:130px" required>
          <option value=''>=请选择=</option>
        </select>
    </td>
  </tr>
    </table>
    </fieldset>
    <div class='jz'>
      <tr>
        <td class="style1">&nbsp;</td>
        <td>
        <input type="hidden" name='shipping_id' value="<?php echo $_smarty_tpl->tpl_vars['shipping_id']->value;?>
">
          <input type="hidden" name="shipping_area_id" value=<?php echo $_smarty_tpl->tpl_vars['aa']->value['shipping_area_id'];?>
>
          <input type="hidden" name="act" value="insert" />
          <a href="JavaScript:void(0);" class="btn" onclick="reset()"><span>重置</span></a>
          <a href="JavaScript:void(0);" class="btn" onclick="$('#tj').click()"><span>确认提交</span></a>
        </td>
      </tr>
    <input type="reset" id="cz" style="display: none;">
    <input type="submit" id="tj" style="display:none;";>
    </div>
  </form>
</div>
</body>

<script>
// 重置方法
function reset(){
	$('input').val('');
	$('textarea').text('');
	$('select').val('');
}
// 配送方式
function abc1(){
  $(".jian").hide();
  $(".zhong").show();
}
function abc2(){
  $(".zhong").hide();
  $(".jian").show();
}
$(window).load(function(){
  var sx=$(".hd");
  for(var i=0;i<sx.length;i++){
    if($(sx).eq(i).attr('checked')=='checked'){
      if($(sx).eq(i).val()=="by_weight"){
        $(".jian").hide();
        $(".zhong").show();
      }else if($(sx).eq(i).val()=="by_number"){
        $(".zhong").hide();
        $(".jian").show();
      }
    }
  }
})

//配送区域
$("#name").blur(function(){
var name = $("#name").val();
var id=$("input[name=shipping_id]").val();
  $.post("shipping_area.php",{act:'name',shipping_area_name:name,id:id},function(data){
    if(data==1){
      alert('配送区域名称已存在');
    }
   });
});

</script>
</html><?php }} ?>